package edu.wfu.preparedDishes.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import edu.wfu.preparedDishes.common.utils.PageUtils;
import edu.wfu.preparedDishes.order.entity.dto.CreateAddressDto;
import edu.wfu.preparedDishes.order.entity.dto.CreateOderDto;
import edu.wfu.preparedDishes.order.entity.dto.toDelOrderDto;
import edu.wfu.preparedDishes.order.entity.po.OrderEntity;
import edu.wfu.preparedDishes.order.entity.vo.AddressVo;
import edu.wfu.preparedDishes.order.entity.vo.DetailsVo;
import edu.wfu.preparedDishes.order.entity.vo.DishesShowVo;
import edu.wfu.preparedDishes.order.entity.vo.IndexVo;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * 订单表;
 *
 * @author tyy
 * @email tyy2019843259@gmail.com
 * @date 2023-11-21 16:29:10
 */
public interface OrderService extends IService<OrderEntity> {



    /**
     * 查询所有订单
     * @param params
     * @return
     */
    PageUtils queryPage(Map<String, Object> params, String userId);

    /**
     * 初始化订单
     * @param userId
     * @return
     */
    String create(String userId, Integer totalPrice);

    Boolean creatOrders(HttpServletRequest request);

    /**
     * 创建订单
     * @param order
     * @return
     */
    boolean save(CreateOderDto order, String userId);

    /**
     * 创建订单之前的订单详情页面
     * @param userId
     * @return
     */
    DetailsVo getDetails(String userId, String orderCode, String type);

    /**
     * 取消订单
     * @param delOrderCodes
     * @return
     */
    Integer cancelOrder(List<String> delOrderCodes);

    /**
     * 新建地址
     * @param createAddressDto
     * @param userId
     * @return
     */
    Integer keepAddress(CreateAddressDto createAddressDto, String userId);

    /**
     * 获得所有收获地址
     * @param userId
     * @return
     */
    List<AddressVo> getAllAddresses(String userId);

    /**
     * 通过orderCode查订单
     * @param orderCode
     * @return
     */

    OrderEntity getByOrderCode(String orderCode);

    /**
     *
     * @param skuIds
     * @return
     */
    List<DishesShowVo> getDishesDetails(String skuIds, String userId);

    List<String> getSrcImages(String skuIds);

    AddressVo getAddressDetail(String addressId);

    IndexVo getIndexShow(String userId);

    Boolean receivin(String orderCode);
}

